﻿@model IEnumerable<Contoso_University.Models.Course>

@{
    ViewData["Title"] = "课程管理";
}

<h1>课程管理</h1>

<p>
    <a asp-action="Create" class="btn btn-primary">新建课程</a>
</p>

<table class="table-striped table">
    <thead>
        <tr>
            <th>
                课程编号
            </th>
            <th>
                课程名称
            </th>
            <th>
                学分
            </th>
            <th>
                所属院系
            </th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.CourseID)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Title)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Credits)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Department.Name)
                </td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.CourseID" class="btn btn-sm btn-outline-primary">编辑</a>
                    <!--<a asp-action="Details" asp-route-id="@item.CourseID" class="btn btn-sm btn-outline-info">详情</a>-->
                    <a asp-action="Delete" asp-route-id="@item.CourseID" class="btn btn-sm btn-outline-danger">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table> 